home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1999 / MacHack 1999.toast / The Hacks / MACtive Desktop / Source / Sources / BaseMenu.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-30  |  1.4 KB  |  134 lines  |  [TEXT/CWIE]

  1. #include "MenuManager.h"
  2. #include "BaseMenu.h"
  3.  
  4.  
  5.  
  6.  
  7.  
  8. extern MenuManager            *gMenuManager;
  9.  
  10.  
  11.  
  12.  
  13.  
  14. BaseMenu::BaseMenu(UInt32 menuID)
  15. {
  16.     fMenu = ::GetMenu(menuID);
  17.     if (fMenu != NULL)
  18.     {
  19.         fFlags = 0;
  20.         gMenuManager->DoAddMenu(this);
  21.     }
  22. }
  23.  
  24.  
  25.  
  26.  
  27.  
  28. void BaseMenu::DoUpdate(void)
  29. {
  30.     HandleUpdate();
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37. void BaseMenu::DoSelect(UInt32 item)
  38. {
  39.     HandleSelect(item);
  40. }
  41.  
  42.  
  43.  
  44.  
  45.  
  46. Boolean BaseMenu::DoSetDisableState(Boolean isBeingDisabled)
  47. {
  48.     if (isBeingDisabled)
  49.     {
  50.         if (!(fFlags & kDisabled))
  51.         {
  52.             fFlags |= kDisabled;
  53.             HandleSetDisableState(isBeingDisabled);
  54.             return true;
  55.         }
  56.     }
  57.     else
  58.     {
  59.         if (fFlags & kDisabled)
  60.         {
  61.             fFlags &= ~kDisabled;
  62.             HandleSetDisableState(isBeingDisabled);
  63.             return true;
  64.         }
  65.     }
  66.     
  67.     return false;
  68. }
  69.  
  70.  
  71.  
  72.  
  73.  
  74. void BaseMenu::DoWindowNotice(Window *window,Boolean isBeingAdded)
  75. {
  76.     HandleWindowNotice(window,isBeingAdded);
  77. }
  78.  
  79.  
  80.  
  81.  
  82.  
  83. void BaseMenu::DoWindowActivation(Window *window,Boolean isBeingActivated)
  84. {
  85.     HandleWindowActivation(window,isBeingActivated);
  86. }
  87.  
  88.  
  89. #pragma mark -
  90.  
  91.  
  92. void BaseMenu::HandleUpdate(void)
  93. {
  94.     
  95. }
  96.  
  97.  
  98.  
  99.  
  100.  
  101. void BaseMenu::HandleSelect(UInt32 item)
  102. {
  103.     
  104. }
  105.  
  106.  
  107.  
  108.  
  109.  
  110. void BaseMenu::HandleSetDisableState(Boolean isBeingDisabled)
  111. {
  112.     if (isBeingDisabled)
  113.         DisableItem(fMenu,0);
  114.     else
  115.         EnableItem(fMenu,0);
  116. }
  117.  
  118.  
  119.  
  120.  
  121.  
  122. void BaseMenu::HandleWindowNotice(Window *window,Boolean isBeingAdded)
  123. {
  124.     
  125. }
  126.  
  127.  
  128.  
  129.  
  130.  
  131. void BaseMenu::HandleWindowActivation(Window *window,Boolean isBeingActivated)
  132. {
  133.     
  134. }